@model BarManager.UI.Web.Models.MesaViewModel

@{ ViewBag.Title = "Mesa";}

@using (Html.BeginForm("Save", "Mesa"))
{
    @Html.AntiForgeryToken()

    <fieldset class="form-horizontal">
        <legend>Mesa</legend>
        @Html.HiddenFor(model => model.Entity.Id)
        <div class="control-group">
            @Html.LabelFor(model => model.Entity.Nombre, new { @class = "control-label" })
            <div class="controls">
                @Html.EditorFor(model => model.Entity.Nombre)
                @Html.ValidationMessageFor(model => model.Entity.Nombre, null, new { @class = "help-inline" })
            </div>
        </div>

        <div class="control-group">
            <label class="control-label">Zona</label>
            <div class="controls">
                <div class="input-append">
                    @Html.DropDownListFor(model => model.Entity.ZonaId, new SelectList(Model.Zonas, "Id", "Descripcion"), "Sin seleccionar", new { @class = "input-xlarge" })
                    @Html.ActionLink("Nuevo", "List", "Zona", null, new { @class = "btn" });
                </div>
                @Html.ValidationMessageFor(model => model.Entity.ZonaId, "Debe seleccionar una Zona")
            </div>
        </div>

        @Html.ValidationSummary(true)

        <div class="control-group">
            <div class="controls">
                <button id="savebutton" type="submit" class="btn btn-primary">Guardar</button>
                @Html.ActionLink("Cancelar", "List", null, new { @class = "btn" })
            </div>
        </div>
    </fieldset>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")

    <script type="text/javascript">
        $("#savebutton").click(function () {
            $("#Empleado_HoraInicio").val($("#fechaAlta").val());
            $("#Empleado_HoraFin").val($("#fechaBaja").val());
        });
    </script>
}

